home *** CD-ROM | disk | FTP | other *** search
/ .net 1999 December / netCD65.iso / mac / madasafish / macsw / Internet Setup / Modem Scripts / GV x2 for ARA 2.1⁄OT-PPP / GV x2 for ARA 2.1_OT-PPP
Encoding:
Text File  |  1997-04-28  |  16.9 KB  |  830 lines

  1. !  Copyright: © 1991-1997 Global Village Communication, Inc.     All Rights Reserved.
  2. !    Portions Authored by: Kris Kreutzman
  3. !    Portions Copyright:    © 1991-1996 Apple Computer, Inc.    All Rights Reserved.
  4. !
  5. !    revision history:
  6. !   1.0.7 04/25/97 GAS        Fixed 19,200 call-back limitation
  7. !   1.0.6 04/16/97 GAS        Modified to support X2 speeds, added new X2 config string
  8. !                           and commented out Fax/ARA discrimination code
  9. !   1.0.5 03/12/97 GAS        Updated code to support K56Flex speeds
  10. !    1.0.4 01/31/97 RHY        Removed the \^ from diaing strings to turn off data
  11. !                            calling tones.
  12. !     1.0.3 11/15/96 DEJ         Added fix for problem when "Ring through modem" is on and 
  13. !                            making ARA connection.
  14. !   1.0.1 09/05/96 DEJ -     Generated basic Apple/Kris Kreutzman script w/MSG 1.0a1.
  15. !                            Integrated earlier/cleaner answer & hangup (rhoiberg),
  16. !                           Platinum mods (SAP), Fax/ARA discrimination (crw), Int'l 
  17. !                           Blacklisting & blind dialing (DEJ), 31.2k & 33.6k (gas).
  18. !                           Added comments, 2.1 features, & better product support.
  19. !  'mlts' resource info for this modem:
  20. !    byte 1 == 01 -> modem HAS built-in error correction protocols
  21. !    byte 2 == 01 -> modem HAS built-in data compression protocols
  22. !    byte 3 == 40 -> max number of chars (hex 28) in varstr 7
  23. !    byte 4 == 40 -> max number of chars (hex 28) in varstr 8
  24. !    byte 5 == 40 -> max number of chars (hex 28) in varstr 9
  25. !    
  26. @ORIGINATE
  27. @ANSWER
  28. ! ---- Initial modem setup ----
  29. ! Start by opening up & resetting the serial port at the speed GlobalFax was using:
  30. serreset 19200, 0, 8, 1
  31. HSReset 0 0 0 0 0 0
  32. settries 0
  33. !
  34. ! If in Answer mode, leave port speed at 19.2 for Fax/ARA discrimination.
  35. ifANSWER 3
  36. ! In originate mode, set serial port speed depending upon the compression flag
  37. !    A higher rate with compression on (PPP) to handle expanded data from the modem
  38. !    A lower rate closer to the DCE when compression is off (ARA)
  39. ifstr 5 1 "0"
  40. serreset 115200, 0, 8, 1
  41. jump 2
  42. !
  43. @LABEL 1
  44. ! If in PPP mode, DTE is set to 115200, above.
  45. !
  46. ifANSWER 3
  47. ! For outgoing ARA calls, bring the port speed up to just above max
  48. ! uncompressed data rate (for TelePort 56K, this would be 57,600).
  49. !
  50. serreset 57600, 0, 8, 1
  51. !
  52. @LABEL 2
  53. hsreset 0 0 0 0 0 0
  54. settries 0
  55. !
  56. ! Get the modem's attention
  57. !
  58. matchclr
  59. matchstr 1 3 "OK\13\10"
  60. write "AT\13"
  61. matchread 30
  62. !
  63. @LABEL 3
  64. ! Setup the modem for the following:
  65. !   AT         Attention
  66. !   &F1        Reset to factory settings
  67. !    &D0           DTR override
  68. !    &H1           Enable CTS Hardware flow control
  69. !    &R1           Disable RTS flow control to prevent RTS/DTR Toggle hangup
  70. !    &B1           Disable autobaud/lock DTE
  71. !    S0=0       Turn off auto-answer
  72. !    E0V1Q0       Turn command echo off and enable verbose responses
  73. !    &A3           Protocol indicators added (LAPM/MNP/NONE)
  74. !   S7=60      Allow 60 seconds for international calls to complete
  75. !
  76. matchclr
  77. matchstr 1 4   "OK\13\10"
  78. matchstr 2 101 "ERROR\13\10"
  79. write "AT&F1&D0&H1&R1&B1S0=0E0V1Q0&A3S7=60\13"
  80. matchread 30
  81. inctries
  82. iftries 3 101
  83. !
  84. ! Reset the Modem on setup failure
  85. !
  86. DTRClear
  87. pause 5
  88. DTRSet
  89. flush
  90. jump 3
  91. ! (Note, this was jump 1 in original GV TP Plat. 2.0 script).
  92. !
  93. !
  94. @LABEL 4
  95. ! Modem now responding and configured for full EC/DC functions.
  96. ! Varstring 4 , reliable link protocol:
  97. !    = 0, handled by computer (ARAP)
  98. !    = 1, handled by modem (PPP)
  99. !    = 2, MNP10 protocol (Cellular protocol, no longer supported)
  100. ! If PPP or Cellular mode, jump to 5, otherwise (ARA) disable EC/DC.
  101. ifstr 4 5 "1"
  102. ifstr 4 5 "2"
  103. !
  104. ! Varstring 4 == 0, turn off reliable link protocol in modem (ARAP)
  105. matchclr
  106. matchstr 1 9 "OK\13\10"
  107. write "AT&M0\13"
  108. matchread 30
  109. jump 101
  110. !
  111. !
  112. @LABEL 5
  113. ! This is where MNP10 (or MNP10EC) could go, if/when we support that.
  114. ! Standard EC/DC is still on.  Decide whether to turn off DC.
  115. ! Varstring 5, compression protocol:
  116. !    = 0, handled by computer 
  117. !    = 1, handled by modem
  118. ifstr 5 9 "1"
  119. !
  120. ! Varstring 5 == 0, turn off compression protocol in modem.
  121. matchclr
  122. matchstr 1 9 "OK\13\10"
  123. write "AT&K0\13"
  124. matchread 30
  125. jump 101
  126. !
  127. !
  128. @LABEL 9
  129. ! If speaker on flag is true, jump to 13.  Otherwise, turn the speaker off.
  130. ! Varstring 2, modem speaker:
  131. !    = 0, speaker off
  132. !    = 1, speaker on
  133. ifstr 2 13 "1"
  134. pause 5
  135. matchclr
  136. matchstr 1 13 "OK\13\10"
  137. write "ATM0\13"
  138. matchread 30
  139. jump 101
  140. !
  141. ! Modem ready, wait for a call or originate a call
  142. !
  143. @LABEL 13
  144. ! In answer mode, jump out and set FAX/DATA discriminating auto-answer.
  145. ifANSWER 88
  146. !
  147. !
  148. ! ---- Originating a call ----
  149. ! For normal dialing, jump to 19.  Otherwise, manual dial jumps to 15, blind dial
  150. !    jumps to 17.
  151. ! Varstring 6, dialing mode:
  152. !    = 0, normal dialing
  153. !    = 1, blind dialing
  154. !    = 2, manual dialing
  155. ifstr 6 17 "1"
  156. ifstr 6 15 "2"
  157. jump 19
  158. !
  159. @LABEL 15
  160. ! Display ASK dialog with message.  Goto label 107 if dialog canceled.
  161. ASK 2 "Pick up the phone & dial ^1.  Hit OK when the phone rings, then hangup." 107
  162. note "Manual dialing initiated" 3
  163. ! X1S6=4 to ignore dialtone 4 seconds, & ignore busy, D to dial, \^ generates data tone
  164. write "ATX1S6=4D\13"
  165. jump 32
  166. !
  167. @LABEL 17
  168. note "Dialing without tone" 3
  169. matchclr
  170. matchstr 1 19 "OK\13\10"
  171. ! X1S6=4 to ignore dialtone 4 seconds, & ignore busy for blind dialing.
  172. write "ATX1S6=4\13"
  173. matchread 30
  174. jump 101
  175. !
  176. !
  177. @LABEL 19
  178. ! This is where we break up long dialstrings
  179. ! Display the full dialstring contained in Varstring 1
  180. note "Dialing ^1" 3
  181. !
  182. ! Varstrings 7, 8 and 9, contain dialstring fragments
  183. !    Long phone numbers may have been split into smaller groups
  184. !    so that the modem can use them
  185. ! Check to see whether these fragments exist.  If they do, dial them one at a time.
  186. ! If not, jump ahead and dial the remaining phone number.  Use the data tone.
  187. ! Varstring 3:  "p" for pulse & "t" for tone dialing
  188. ! Varstring 8 == blank (dialstring in varstring 7)
  189. ! Varstring 9 == blank (dialstring in varstrings 7 & 8)
  190. ! Otherwise (dialstring in varstrings 7, 8 & 9)
  191. ifstr 8 27 " "
  192. ifstr 9 24 " "
  193. !
  194. !  Write dialstring in varstrings 7, 8 & 9
  195. matchclr
  196. matchstr 1 21 "OK\13\10"
  197. write "ATD^3^7;\13"
  198. matchread 400
  199. jump 101
  200. @LABEL 21
  201. matchclr
  202. matchstr 1 22 "OK\13\10"
  203. write "ATD^3^8;\13"
  204. matchread 400
  205. jump 101
  206. @LABEL 22
  207. write "ATD^3^9\13"
  208. jump 32
  209. !
  210. !
  211. @LABEL 24
  212. !  Write dialstring in varstrings 7 & 8
  213. matchclr
  214. matchstr 1 25 "OK\13\10"
  215. write "ATD^3^7;\13"
  216. matchread 400
  217. jump 101
  218. @LABEL 25
  219. write "ATD^3^8\13"
  220. jump 32
  221. !
  222. @LABEL 27
  223. !  Write dialstring in varstring 7
  224. write "ATD^3^7\13"
  225. !
  226. !
  227. !    ---- Connection response ----
  228. !
  229. ! The following section will parse modem responses of five types:
  230. !   1) PROTOCOL: xxx, COMPRESSION: xxx, CONNECT xxx
  231. !   2) CONNECT xxx/ARQ/V42
  232. !   3) Standard incoming and outgoing call progress messages
  233. !   4) FAX/DATA discrimination messages
  234. !   5) International DELAYED & BLACKLISTED restrictions.
  235. !
  236. @LABEL 32
  237. matchclr
  238. matchstr  1 81  "RING\13\10"
  239. matchstr  2 102 "NO DIAL TONE\13\10"
  240. matchstr  3 103 "NO CARRIER"
  241. matchstr  4 103 "ERROR\13\10"
  242. matchstr  5 104 "BUSY\13\10"
  243. matchstr  6 105 "NO ANSWER\13\10"
  244. matchstr  7 33  "CONNECT "
  245. matchstr  8 32  "CARRIER"
  246. matchstr  9 40  "CONNECT\13\10"
  247. matchstr 10 74  "PROTOCOL: LAP"
  248. matchstr 11 74  "PROTOCOL: MNP"
  249. matchstr 12 74  "PROTOCOL: ALT"
  250. matchstr 13 76  "COMPRESSION: V"
  251. matchstr 14 76  "COMPRESSION: MNP5"
  252. matchstr 15 76  "COMPRESSION: CLASS"
  253. matchstr 16 82  "FAX\13\10"
  254. matchstr 17 84  "DATA\13\10"
  255. matchstr 18 110  "DELAYED  "
  256. matchstr 19 111  "BLACKLISTED\13\10"
  257. matchread 700
  258. ifANSWER 32
  259. jump 101
  260. !
  261. !  Parse the speed of connect result codes
  262. !  1200, 2400 and 4800 have two entries each
  263. !  to distinguish them from 12000, 24000 and 48000
  264. ! (added 1200bps support)
  265. !
  266. @LABEL 33
  267. matchclr
  268. matchstr  1 41 "4800\13"
  269. matchstr  2 41 "4800/"
  270. matchstr  3 42 "7200"
  271. matchstr  4 43 "9600"
  272. matchstr  5 44 "12000"
  273. matchstr  6 45 "14400"
  274. matchstr  7 46 "16800"
  275. matchstr  8 47 "19200"
  276. matchstr  9 48 "21600"
  277. matchstr 10 49 "24000"
  278. matchstr 11 50 "26400"
  279. matchstr 12 51 "28800"
  280. matchstr 13 52 "31200"
  281. matchstr 14 53 "32000"
  282. matchstr 15 54 "33600"
  283. matchstr 16 55 "33333"
  284. matchstr 17 56 "36000"
  285. matchstr 18 57 "37333"
  286. matchstr 19 58 "40000"
  287. matchstr 20 59 "41333"
  288. matchstr 21 60 "42666"
  289. matchstr 22 61 "44000"
  290. matchstr 23 62 "45333"
  291. matchstr 24 63 "46666"
  292. matchstr 25 64 "48000"
  293. matchstr 26 65 "49333"
  294. matchstr 27 66 "50666"
  295. matchstr 28 67 "52000"
  296. matchstr 29 68 "53333"
  297. matchstr 30 69 "54666"
  298. matchstr 31 70 "56000"
  299. matchread 30
  300. jump 71
  301. !
  302. ! -- Connection rates --
  303. ! CommunicatingAt informs ARA of the raw modem to modem
  304. ! connection speed.
  305. !
  306. @LABEL 39
  307. note "Communicating at 1200 bps." 2
  308. CommunicatingAt 1200
  309. jump 72
  310. !
  311. @LABEL 40
  312. note "Communicating at 2400 bps." 2
  313. CommunicatingAt 2400
  314. jump 72
  315. !
  316. @LABEL 41
  317. note "Communicating at 4800 bps." 2
  318. CommunicatingAt 4800
  319. jump 72
  320. !
  321. @LABEL 42
  322. note "Communicating at 7200 bps." 2
  323. CommunicatingAt 7200
  324. jump 72
  325. !
  326. @LABEL 43
  327. note "Communicating at 9600 bps." 2
  328. CommunicatingAt 9600
  329. jump 72
  330. !
  331. @LABEL 44
  332. note "Communicating at 12000 bps." 2
  333. CommunicatingAt 12000
  334. jump 72
  335. !
  336. @LABEL 45
  337. note "Communicating at 14400 bps." 2
  338. CommunicatingAt 14400
  339. jump 72
  340. !
  341. @LABEL 46
  342. note "Communicating at 16800 bps." 2
  343. CommunicatingAt 16800
  344. jump 72
  345. !
  346. @LABEL 47
  347. note "Communicating at 19200 bps." 2
  348. CommunicatingAt 19200
  349. jump 72
  350. !
  351. @LABEL 48
  352. note "Communicating at 21600 bps." 2
  353. CommunicatingAt 21600
  354. jump 72
  355. !
  356. @LABEL 49
  357. note "Communicating at 24000 bps." 2
  358. CommunicatingAt 24000
  359. jump 72
  360. !
  361. @LABEL 50
  362. note "Communicating at 26400 bps." 2
  363. CommunicatingAt 26400
  364. jump 72
  365. !
  366. @LABEL 51
  367. note "Communicating at 28800 bps." 2
  368. CommunicatingAt 28800
  369. jump 72
  370. !
  371. @LABEL 52
  372. note "Communicating at 31200 bps." 2
  373. CommunicatingAt 31200
  374. jump 72
  375. !
  376. @LABEL 53
  377. note "Communicating at 32000 bps." 2
  378. CommunicatingAt 32000
  379. jump 72
  380. !
  381. @LABEL 54
  382. note "Communicating at 33600 bps." 2
  383. CommunicatingAt 33600
  384. jump 72
  385. !
  386. @LABEL 55
  387. note "Communicating at 33333 bps." 2
  388. CommunicatingAt 33333
  389. jump 72
  390. !
  391. @LABEL 56
  392. note "Communicating at 36000 bps." 2
  393. CommunicatingAt 36000
  394. jump 72
  395. !
  396. @LABEL 57
  397. note "Communicating at 37333 bps." 2
  398. CommunicatingAt 37333
  399. jump 72
  400. !
  401. @LABEL 58
  402. note "Communicating at 40000 bps." 2
  403. CommunicatingAt 40000
  404. jump 72
  405. !
  406. @LABEL 59
  407. note "Communicating at 41333 bps." 2
  408. CommunicatingAt 41333
  409. jump 72
  410. !
  411. @LABEL 60
  412. note "Communicating at 42666 bps." 2
  413. CommunicatingAt 42666
  414. jump 72
  415. !
  416. @LABEL 61
  417. note "Communicating at 44000 bps." 2
  418. CommunicatingAt 44000
  419. jump 72
  420. !
  421. @LABEL 62
  422. note "Communicating at 45333 bps." 2
  423. CommunicatingAt 45333
  424. jump 72
  425. !
  426. @LABEL 63
  427. note "Communicating at 46666 bps." 2
  428. CommunicatingAt 46666
  429. jump 72
  430. !
  431. @LABEL 64
  432. note "Communicating at 48000 bps." 2
  433. CommunicatingAt 48000
  434. jump 72
  435. !
  436. @LABEL 65
  437. note "Communicating at 49333 bps." 2
  438. CommunicatingAt 49333
  439. jump 72
  440. !
  441. @LABEL 66
  442. note "Communicating at 50666 bps." 2
  443. CommunicatingAt 50666
  444. jump 72
  445. !
  446. @LABEL 67
  447. note "Communicating at 52000 bps." 2
  448. CommunicatingAt 52000
  449. jump 72
  450. !
  451. @LABEL 68
  452. note "Communicating at 53333 bps." 2
  453. CommunicatingAt 53333
  454. jump 72
  455. !
  456. @LABEL 69
  457. note "Communicating at 54666 bps." 2
  458. CommunicatingAt 54666
  459. jump 72
  460. !
  461. @LABEL 70
  462. note "Communicating at 56000 bps." 2
  463. CommunicatingAt 56000
  464. jump 72
  465. !
  466. ! Labels 67-70 saved for future speed expansion
  467. !
  468. @LABEL 71
  469. note "Communicating at an unknown rate." 2
  470. jump 72
  471. !
  472. ! Look for reliablilty and compression results 
  473. ! at the end of the connect result.
  474. !
  475. @LABEL 72
  476. matchclr
  477. matchstr  1 75 "LAPM"
  478. matchstr  2 75 "REL"
  479. matchstr  3 75 "ARQ"
  480. matchstr  4 77 "COMP/"
  481. matchstr  5 77 "COMP\13"
  482. matchstr  6 75 "V42/"
  483. matchstr  7 75 "V42\13"
  484. matchstr  8 77 "V42BIS"
  485. matchstr  9 77 "V42bis"
  486. matchstr 10 75 "MNP\13"
  487. matchstr 11 77 "MNP5"
  488. matchstr 12 78 "\10"
  489. matchread 30
  490. jump 78
  491. ! -- Modem error correction link negotiation --
  492. ! Userhook 2 informs ARA that a modem-to-modem error
  493. ! correcting protocol has been negotiated
  494. !
  495. !
  496. @LABEL 74
  497. note "Modem Reliable Link Established." 2
  498. userhook 2
  499. jump 32
  500. !
  501. @LABEL 75
  502. note "Modem Reliable Link Established." 2
  503. userhook 2
  504. jump 72
  505. !
  506. ! -- Compression negotiation --
  507. ! Userhook 3 informs ARA that a modem-to-modem compression
  508. ! protocol has been negotiated
  509. !
  510. @LABEL 76
  511. note "Modem Compression Established." 2
  512. userhook 3
  513. jump 32
  514. !
  515. @LABEL 77
  516. note "Modem Compression Established." 2
  517. userhook 3
  518. jump 72
  519. !
  520. !
  521. ! -- Normal exit after "CONNECT" --
  522. !
  523. !  This modem has been setup to do CTS handshaking,
  524. !  and we assume that a CTS handshaking cable is being used.
  525. !
  526. @LABEL 78
  527. ! Turn on CTS handshaking.
  528. HSReset 0 1 0 0 0 0
  529. !
  530. ifANSWER 79
  531. pause 30
  532. @LABEL 79
  533. exit 0
  534. !
  535. !
  536. ! ---- Answer calls ----
  537. !
  538. !    (Converted active ATA answering to a passive FAX/DATA discrimination method.)
  539. !
  540. @LABEL 81
  541. ifORIGINATE 32
  542. note "Answering phone..." 2
  543. jump 32
  544. @LABEL 82
  545. note "Answering Fax call..."
  546. matchclr
  547. matchstr 1 83 "CONNECT\13\10"
  548. matchread 100
  549. jump 101
  550. !
  551. @LABEL 83
  552. settries 1225
  553. sbreak
  554. pause 80
  555. note "A Fax call was received, but could not be answered."
  556. settries 0
  557. jump 95
  558. @LABEL 84
  559. ! Incoming call is DATA, not FAX.
  560. ! For GlobalFax, answering port speed was 19.2k. If compression is on (PPP), set
  561. ! a serial port speed of 115.2k. Otherwise, we're in ARA, so jump to 85.
  562. !
  563. !    Tell ARA to claim the serial port
  564. userhook 1
  565. ifstr 5 85 "0"
  566. serreset 115200, 0, 8, 1
  567. write "ATO\13"
  568. jump 32
  569. @LABEL 85
  570. ! Answering port speed is still 19.2k. Compression is off (ARA). Use 57.6.
  571. serreset 57600, 0, 8, 1
  572. write "ATO\13"
  573. jump 32
  574. @LABEL 88
  575. ! Attempt to set Answer mode w/FAX/DATA discrimination, then go into wait mode.
  576. ! If the modem cannot do FAX/DATA discriminination, jump to 89.
  577. !
  578. ! GV QA chooses to not support FAX/DATA discrimination in this X2 script.
  579. ! The script will jump straight to LABEL 89. If we decide to support
  580. ! FAX/DATA discrimination in the future, uncomment the following line:
  581. !
  582. jump 89
  583. !
  584. ! Issue "AT~GR0" to turn off ring through modem on TelePort Speakerphones. This
  585. ! will generate an error on other GV modems, but that's OK. We just issue the 
  586. ! command, wait three seconds and move on.
  587. ! Following line commented out for X2 modems (command doesn't apply)
  588. ! write "AT~GR0\13"
  589. ! pause 3
  590. matchclr
  591. matchstr 1 32 "OK\13\10"
  592. matchstr 2 89 "ERROR\13\10"
  593. ! If GV decides to enable FAX/DATA discrimination, put the correct command
  594. ! on the following line (the current command is for Rockwell).
  595. write "AT+FAE=1S0=1\13"
  596. matchread 30
  597. @LABEL 89
  598. ! Set regular answer mode, for modems that don't do FAX/DATA discrimination.
  599. !
  600. serreset 57600, 0, 8, 1 
  601. matchclr
  602. matchstr 1 32 "OK\13\10"
  603. write "ATS0=1\13"
  604. matchread 30
  605. jump 101
  606. ! ---- Hang up and reset modem ----
  607. !
  608. @HANGUP
  609. ! If we do this too long, exit.
  610. iftries 1225 99
  611. @LABEL 90
  612. settries 0
  613. HSReset 0 0 0 0 0 0
  614. !
  615. @LABEL 91
  616. ! Try to get control of the modem
  617. DTRClear
  618. Pause 5
  619. DTRSet
  620. flush
  621. !
  622. @LABEL 94
  623. ! Force a hangup
  624. matchclr
  625. matchstr 1 98 "NO CARRIER\13\10"
  626. matchstr 2 98 "OK\13\10"
  627. matchstr 3 98 "ERROR\13\10"
  628. matchstr 4 98 "0\13\10"
  629. matchstr 5 98 "DELAYED"
  630. matchstr 6 98 "BLACKLISTED"
  631. write "ATH\13"
  632. matchread 30
  633. ! Try again to get control of the modem by toggling DTR
  634. !
  635. @LABEL 95
  636. DTRClear
  637. Pause 5
  638. DTRSet
  639. flush
  640. !  Escape from data to command mode using standard +++ command
  641. matchclr
  642. matchstr 1 96 "OK\13\10"
  643. pause 15
  644. write "+++"
  645. matchread 15
  646. !
  647. !
  648. ! Try the hangup sequence three times otherwise declare an error
  649. inctries
  650. iftries 3 101
  651. jump 95
  652. !
  653. @LABEL 96
  654. !
  655. ! Pause between data and command mode
  656. !
  657. pause 50
  658. jump 94
  659. !
  660. !
  661. @LABEL 97
  662. ! AT&F1 resulted in Error, try again using AT&F
  663. pause 15
  664. matchclr
  665. matchstr 1 99 "OK\13\10"
  666. write "AT&FS0=0\13"
  667. matchread 30
  668. jump 101
  669. !
  670. @LABEL 98
  671. ! Got control of the modem.  Recall the factory settings.  If it fails, jump 97.
  672. pause 15
  673. matchclr
  674. matchstr 1 99 "OK\13\10"
  675. matchstr 2 97 "ERROR\13\10"
  676. write "AT&F1S0=0\13"
  677. matchread 30
  678. jump 101
  679. !
  680. @LABEL 99
  681. exit 0
  682. !
  683. ! ---- Error messages -----
  684. !
  685. ! Modem Not Responding
  686. @LABEL 101
  687. exit -6019
  688. !
  689. ! No Dial Tone
  690. @LABEL 102
  691. exit -6020
  692. !
  693. ! No Carrier or Error
  694. @LABEL 103
  695. exit -6021
  696. !
  697. ! Busy
  698. @LABEL 104
  699. exit -6022
  700. !
  701. ! No Answer
  702. @LABEL 105
  703. exit -6023
  704. !
  705. ! User Cancellation
  706. @LABEL 107
  707. exit -6008
  708. !
  709. ! ---- DELAYED and BLACKLISTED functions ----
  710. @LABEL 110
  711. matchclr
  712. matchstr  1 119 "00:00:0"
  713. matchstr  2 118 "00:00:1"
  714. matchstr  3 117 "00:00:2"
  715. matchstr  4 116 "00:00:3"
  716. matchstr  5 115 "00:00:4"
  717. matchstr  6 114 "00:00:5"
  718. matchstr  7 113 "00:01:"
  719. matchstr  8 112 "00:02:"
  720. matchread 30
  721. !  The number is 'DELAYED' more than 3 minutes.  Exit the script telling the user to wait or reset his modem.
  722. !
  723. exit -6019 "\13The modem responds 'DELAYED':\13(Cannot redial this number right now.)\13To try again immediately, turn modem OFF and ON before proceeding."
  724. @LABEL 111
  725. !  The number is 'BLACKLISTED'.  Exit the script, telling the user to reset his modem.
  726. exit -6019 "\13The modem responds 'BLACKLISTED':\13(Cannot redial this number again.)\13Double-check the number, then turn your modem OFF and ON before proceeding."
  727. !
  728. @LABEL 112
  729. note "'DELAYED'. Redialing in 3 minutes..."
  730. pause 600
  731. @LABEL 113
  732. note "'DELAYED'. Redialing in 2 minutes..."
  733. pause 600
  734. @LABEL 114
  735. note "'DELAYED'. Redialing in 1 minute... "
  736. pause 100
  737. @LABEL 115
  738. note "'DELAYED'. Redialing in 50 seconds..."
  739. pause 100
  740. @LABEL 116
  741. note "'DELAYED'. Redialing in 40 seconds..."
  742. pause 100
  743. @LABEL 117
  744. note "'DELAYED'. Redialing in 30 seconds..."
  745. pause 100
  746. @LABEL 118
  747. note "'DELAYED'. Redialing in 20 seconds..."
  748. pause 100
  749. @LABEL 119
  750. note "'DELAYED'. Redialing in 10 seconds..."
  751. pause 100
  752. jump 1
  753. ! Labels 121-128 are reserved for emergency hacks.
  754.